<div class="fsh-pop">
    <div id="add_form" class="layui-form">
    <input type="hidden" name="id" id="id" value="<%=id%>"/>
        <!--
        <div class="layui-form-item">
        <label class="layui-form-label"><i>*</i>用户账号</label>
            <div class="layui-input-block">
                <input type="text" name="account" lay-verify="required" placeholder="请输入用户账号" class="layui-input" value="<%=account%>">
            </div>
        </div>
        -->
        <div class="layui-form-item">
            <label class="layui-form-label"><i></i>微信号</label>
            <div class="layui-input-block">
                <input type="text" name="wx" placeholder="请输入微信号" class="layui-input" value="<%=wx%>">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i>*</i>用户昵称</label>
            <div class="layui-input-block">
                <input name="nickName" maxlength="20" lay-verify="required" placeholder="请输入用户昵称" class="layui-input" value="<%=nickName%>">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i></i>性别</label>
            <div class="layui-input-block">
                <input type="radio" name="gender" value="1" title="男">
      			<input type="radio" name="gender" value="0" title="女">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i></i>电话</label>
            <div class="layui-input-block">
                <input name="phone" maxlength="200" placeholder="请输入电话" class="layui-input" value="<%=phone%>">
            </div>
        </div>
        <!--
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i>*</i>地址</label>
            <div class="layui-input-block">
                <input name="address" maxlength="200" lay-verify="required" placeholder="请输入地址" class="layui-input" value="<%=address%>">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"><i>*</i>计算结果</label>
            <div class="layui-input-block">
                <input name=calcResult maxlength="200" lay-verify="required" placeholder="请输入计算结果" class="layui-input" value="<%=calcResult%>">
            </div>
        </div>
        -->
        <div class="layui-form-item">
		    <label class="layui-form-label">用户类型</label>
		    <div class="layui-input-block">
		      <select name="userType" lay-filter="userType" id="userType">
		        <option value="-1">请选择</option>
		      </select>
		    </div>
		  </div>
        <!--
        <div class="layui-form-item wx-search">
        <label class="layui-form-label"><i>*</i>使用时间</label>
         <div class="layui-inline">
                    <input type="text" class="layui-input"  name="useTime" value="<%=useTime%>" id="useTime" style="width: 200px">
                     <i class="iconfont icon-rili"></i>
         </div>
         </div>
         -->
          <div class="layui-form-item wx-search">
        <label class="layui-form-label"><i>*</i>到期时间</label>
         <div class="layui-inline">
                    <input type="text" class="layui-input" name="endTime" value="<%=endTime%>" id="endTime" style="width: 200px">
                     <i class="iconfont icon-rili"></i>
         </div>
         </div>
         
         <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input type="text" name="memo" maxlength="200" placeholder="请输入内容" class="layui-input" value="<%=memo%>"/>
            </div>
        </div>
    </div>
</div>
<script>
$(function(){
	
	 //设置性别
	$('[name=gender]').each(function(index,item){
		if($(item).val()==<%=gender %>){
			$(item).prop('checked',true);
			layui.use('form',function(){
				var form = layui.form;
				form.render();
			});
		}
	});
	//设置性别结束
	
	
	//异步加载类型
	$.ajax({  
        url:'/registerUserType/findAll',  
        dataType:'json',  
        type:'post',  
        success:function(data){  
            $.each(data,function(index,item){  
                $('#userType').append(new Option(item.name,item.id));// 下拉菜单里添加元素  
            })                
            //下拉菜单渲染 把内容加载进去      
            layui.use(['form'], function(){
                var form1 = layui.form;
                form1.render();
            });
            
            //动态选中
        	var select = 'dd[lay-value=' +<%=userType%> + ']';  
        	$('#userType').siblings("div.layui-form-select").find('dl').find(select).click();  
        }  
    });  
	
});
layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  //日期时间选择器
	  laydate.render({
	    elem: '#useTime'
	    ,type: 'datetime'
	  });
	  laydate.render({
		    elem: '#endTime'
		    ,type: 'datetime'
	});
});

</script>